 grammar {
  
  author-element= element author {
   attribute id {text},
   name-element,
   born-element,
   dead-element
  }
  
  book-element = element book {
   attribute id {text},
   attribute available {text},
   isbn-element,
   title-element,
   author-element *,
   character-element*
  }
  
  born-element = element born {text}
  
  character-element =  element character {
   attribute id {text},
   name-element,
   born-element,
   qualification-element
  }
  
  dead-element = element dead {text}
  
  isbn-element = element isbn {text}
  
  name-element = element name {
		text|(
			element first{text},
			element middle{text}?,
			element last{text}
			)}
  
  qualification-element = element qualification {text}
  
  title-element = element title {attribute xml:lang {text}, text}
  
  start = element library { 
   book-element +
  }
 }
